package com.gsww.vue.service.sys.impl;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.gsww.vue.service.BasicService;
import com.gsww.vue.service.sys.SysOperatorService;
@Service
@Transactional
public class SysOperatorServiceImpl extends BasicService implements SysOperatorService{

	@Override
	public Map<String, Object> getOperatorList(String operatorName, String keyword, String pageNo, String pageSize)
			throws Exception {
		List<Object> paramList = new ArrayList<Object>();
		StringBuilder sb = new StringBuilder();
		sb.append("select t.*,(select menu_name from sys_menu m where m.menu_id=t.menu_id) as menu_name from sys_operator t where 1=1 ");
		if(StringUtils.isNotBlank(operatorName)){
			sb.append(" and t.operator_name like ?");
			paramList.add("%"+operatorName+"%");
		}
		sb.append("order by t.menu_id asc ");
		Map<String, Object> map = super.page( sb.toString(),paramList, pageNo, pageSize);
		//map.put("head", super.readJson(riverLake).get(tableName));
		return map;
	}

}
